import config from '@/config.js'
export default {
	state:{
		areaId: '',
		areaName: '',
		pageWidth: 0,
		pageHeight: 0,
		screenHeight: 0,
		menuBtnTop: 48,
		statusBarHeight: 0,
		envVersion: '',// 正式环境 release 开发环境 develop 体验版 trial
		system: uni.getSystemInfoSync() || null,
	},
	actions:{
	},
	mutations:{
		setPageWidth (state,data) {
			state.pageWidth = data;
			uni.setStorageSync('pageWidth', data)
		},
		setPageHeight (state,data) {
			state.pageHeight = data;
			uni.setStorageSync('pageHeight', data)
		},
		setScreenHeight (state,data) {
			state.screenHeight = data;
			uni.setStorageSync('screenHeight', data)
		},
		setMenuBtnTop (state,data) {
			state.menuBtnTop = data
			uni.setStorageSync('menuBtnTop', data)
		},
		setStatusBarHeight (state,data) {
			state.statusBarHeight = data
			uni.setStorageSync('statusBarHeight', data)
		},
		setEnvVersion (state,data) {
			state.envVersion = data
			uni.setStorageSync('envVersion', data)
		},
		setArea (state,data) {
			for (let key in data) {
				state[key] = data[key]
				uni.setStorageSync(key, data[key])
			}
		}
	}
}